		
		//验证用户输入
		/*创建XMLHttpRequest的函数*/
		function createXHR() {
		    var xhr = null;
			if(window.XMLHttpRequest) {
				xhr = new XMLHttpRequest();
			} else if(window.ActiveXObject) {
				xhr = new ActiveXobject("Micrssoft.XMLHTTP");
			}
			return xhr;
		}
		var myXmlHttpRequest="";


		// 注册页面
		// 验证注册用户的用户名
		function checkName(id){
			// ajax发送请求
			myXmlHttpRequest=createXHR();
			if(myXmlHttpRequest){
				var url="/index.php/User/yonghuming"; //post
				// 将当前选择的资源的值 当前选择的资源id 已选择的技术分类的值 同时传入后台判断
				var data="uname="+document.getElementById(''+id+'').value;
				myXmlHttpRequest.open("post",url,true);//异步方式
				myXmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				//指定回掉函数 chuli函数名
				myXmlHttpRequest.onreadystatechange=chuliName;
				//发送
				myXmlHttpRequest.send(data);
			}
		}
		function chuliName(){		
			if(myXmlHttpRequest.readyState==4){
				//完成
				if(myXmlHttpRequest.status==200){
					// 接收服务器返回值 存在为1 不存在为0
					var yonghuming = this.responseText;
					// 获取提示位置的ID
					var tishi = document.getElementById('tishi_uname');
					// 校验用户名是否符合正则
					var yonghu = document.getElementById('uname').value;
			    	var zhenze = /^[\u4E00-\u9FA5\uF900-\uFA2D]*$/;
			        var result = zhenze.test(yonghu);

			        if(result == false){
				      	tishi.innerHTML = "请输入中文用户名";
						tishi.style.color="red";
				    }

					if(yonghuming == 1){
						tishi.innerHTML = "该用户已存在";
						tishi.style.color="red";
					}else if(yonghuming == 0 && result == true){
						tishi.innerHTML = "用户验证通过";
						tishi.style.color="#2878FF";
					}

				    
				}
			}
		}

		// 正则验证密码是否符合
	 	function checkpwd(id){
	   		var pwd=document.getElementById(''+id+'').value;
	    	var zhenze =/^[a-zA-Z]\w{5,17}$/;
	        var result=  zhenze.test(pwd);
	        var tishi = document.getElementById('tishi_pwd');
		    if(result){
		    	tishi.innerHTML = "密码验证通过";
				tishi.style.color="#2878FF";
		    }else if(!result || pwd == ''){
		      	tishi.innerHTML = "密码需以字母开头，6-18个字符";
				tishi.style.color="red";
		    }
		}

		// 判断两次密码是否相等
	 	function checkquerenpwd(id){
	   		var pwd2=document.getElementById(''+id+'').value;
	   		var pwd=document.getElementById('pwd').value;
	        var tishi = document.getElementById('tishi_querenpwd');
		    if(pwd == pwd2){
		    	tishi.innerHTML = "确认密码验证通过";
				tishi.style.color="#2878FF";
		    }else{
		      	tishi.innerHTML = "两次输入的密码不一致，请重新输入!";
				tishi.style.color="red";
		    }
		}

		// 正则验证邮箱是否符合
	 	function checkemail(id){
	   		var email=document.getElementById(''+id+'').value;
	    	var zhenze =/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/;
	        var result=  zhenze.test(email);
	        var tishi = document.getElementById('tishi_email');
		    if(result){
		    	tishi.innerHTML = "邮箱验证通过";
				tishi.style.color="#2878FF";
		    }else if(!result || email == ''){
		      	tishi.innerHTML = "请输入正确邮箱地址";
				tishi.style.color="red";
		    }
		}

		// 验证验证码是否正确  登陆 注册 分享资源页面同时使用
		function checkyanzhenma(id){
			// ajax发送请求
			myXmlHttpRequest=createXHR();
			if(myXmlHttpRequest){
				var url="/index.php/User/checkyanzhenma"; //post
				// 将当前选择的资源的值 当前选择的资源id 已选择的技术分类的值 同时传入后台判断
				var data="yanzhenma="+document.getElementById(''+id+'').value;
				myXmlHttpRequest.open("post",url,true);//异步方式
				myXmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				//指定回掉函数 chuli函数名
				myXmlHttpRequest.onreadystatechange=chuliyanzhenma;
				//发送
				myXmlHttpRequest.send(data);
			}
		}
		function chuliyanzhenma(){		
			if(myXmlHttpRequest.readyState==4){
				//完成
				if(myXmlHttpRequest.status==200){
					// 接收服务器返回值 存在为1 不存在为0
					var yonghuming = this.responseText;
					// 获取提示位置的ID
					var tishi = document.getElementById('tishi_yanzhenma');
					if(yonghuming == 1){
						tishi.innerHTML = "验证码正确";
						tishi.style.color="#2878FF";
					}else if(yonghuming == 0){
						tishi.innerHTML = "验证码错误";
						tishi.style.color="red";
					}
				}
			}
		}


		// 登陆界面
		// 验证登陆用户的用户名
		function checkyonghudenglu(id){
			// ajax发送请求
			myXmlHttpRequest=createXHR();
			if(myXmlHttpRequest){
				var url="/index.php/User/yonghuming"; //post
				// 将当前选择的资源的值 当前选择的资源id 已选择的技术分类的值 同时传入后台判断
				var data="uname="+document.getElementById(''+id+'').value;
				myXmlHttpRequest.open("post",url,true);//异步方式
				myXmlHttpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
				//指定回掉函数 chuli函数名
				myXmlHttpRequest.onreadystatechange=chuliyonghudenglu;
				//发送
				myXmlHttpRequest.send(data);
			}
		}
		function chuliyonghudenglu(){		
			if(myXmlHttpRequest.readyState==4){
				//完成
				if(myXmlHttpRequest.status==200){
					// 接收服务器返回值 存在为1 不存在为0
					var yonghuming = this.responseText;
					// 获取提示位置的ID
					var tishi = document.getElementById('tishi_yonghudenglu');
					if(yonghuming == 1){
						tishi.innerHTML = "用户名验证通过";
						tishi.style.color="#2878FF";
					}else if(yonghuming == 0){
						tishi.innerHTML = "请输入正确用户名";
						tishi.style.color="red";
					}
				}
			}
		}


		// 分享资源页面
		// 判断资源名是否为空
	 	function checkziyuanming(id){
	   		var ziyuanming=document.getElementById(''+id+'').value;
	        var tishi = document.getElementById('tishi_ziyuanming');
		    if(ziyuanming !== ""){
		    	tishi.innerHTML = "资源名验证通过";
				tishi.style.color="#2878FF";
		    }else{
		      	tishi.innerHTML = "资源名不能为空";
				tishi.style.color="red";
		    }
		}

		// 判断链接地址是否为空
	 	function checklianjie(id){
	   		var ziyuanming=document.getElementById(''+id+'').value;
	        var tishi = document.getElementById('tishi_lianjie');
		    if(ziyuanming !== ""){
		    	tishi.innerHTML = "链接地址验证通过";
				tishi.style.color="#2878FF";
		    }else{
		      	tishi.innerHTML = "链接地址不能为空";
				tishi.style.color="red";
		    }
		}